<script>
    $(document).ready(function($) {
        $(".cb-enable").click(function(){
            var parent = $(this).parents('.switch');
            $('.cb-disable',parent).removeClass('selected');
            $(this).addClass('selected');
            $('.checkbox',parent).attr('checked', true);
        });

        $(".cb-disable").click(function(){
            var parent = $(this).parents('.switch');
            $('.cb-enable',parent).removeClass('selected');
            $(this).addClass('selected');
            $('.checkbox',parent).attr('checked', false);
        });
    });
</script>

<div class="tales_stats_menu">
    <ui>
        <li class="tales_of_deonia"><?php echo __(LANG_TALES_OF_DEONIA)?></li>
    </ui>
</div>

<div class="system_main">
    <div style="height: 200px;border: 1px solid #000;width: 350px;">
        <?php if(!empty($server)) {?>
            <div>
                <?php echo $this->Form->create('system_setting');?>
                <?php echo $this->Form->hidden('num', array(
                    'label' => false,
                    'value' => $server['tbl_system_notice']['num']
                ));?>
            </div>
            <div class="div_title"><?php echo __('System Setting')?></div>
            <table border="0">
                <tr>
                    <th class="user" style="width: 120px"><?php echo __('Server Status')?></th>
                    <td class="background_white" style="padding-right: 19px; font-size: 11px">
                        <div class="field switch">
                            <?php if($server['tbl_system_notice']['server_status'] == 0) {?>
                                <label class="cb-enable selected" for="typeOn1"><span>On</span></label>
                                <label class="cb-disable" for="typeOff1"><span>Off</span></label>
                            <?php } else { ?>
                                <label class="cb-enable" for="typeOn1"><span>On</span></label>
                                <label class="cb-disable selected" for="typeOff1"><span>Off</span></label>
                            <?php }?>
                            <input type="radio" name="data[system_setting][server_status]" id="typeOn1" value="0" />
                            <input type="radio" name="data[system_setting][server_status]" id="typeOff1" value="1" />
                        </div>
                    </td>
                </tr>
            </table>
            <table>
                <tr>
                    <td class="message_box no_border">
                        <?php if(!empty($err_msg)) {?>
                            <p class="error_message"><?php echo $err_msg?></p>
                        <?php } else  if(!empty($sus_msg)){?>
                            <p class="success_message"><?php echo $sus_msg?></p>
                        <?php }?>
                    </td>
                    <td class="no_border" style="text-align: right">
                        <?php echo $this->Form->end(__(LANG_SEND));?>
                    </td>
                </tr>
            </table>
        <?php }?>
    </div>
</div>